package com.example.administrator.yunniuusedcar.holder;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import com.example.administrator.common.ui.BaseAdapterRV;
import com.example.administrator.common.ui.BaseHolderRV;
import com.example.administrator.yunniuusedcar.R;
import com.example.administrator.yunniuusedcar.adapter.MainNewInfoAdapter;
import com.example.administrator.yunniuusedcar.model.mode_benn.ZD_ArticleTopBean;
import java.util.List;

/**  当日头条  置顶文章
 * Created by USER2015 on 2017/12/17.
 */

public class Info01NewHeaderHolder extends BaseHolderRV<ZD_ArticleTopBean> {


    private RecyclerView recyclerView03;
    private MainNewInfoAdapter homeRanCarAdapter;


    /**
     * 构造方法
     *
     * @param context     上下文对象
     * @param parent      指RecyclerView控件
     * @param adapter     适配器
     *., @param layoutResId RecyclerView的一个item布局文件
     */
    public Info01NewHeaderHolder(Context context, ViewGroup parent, BaseAdapterRV<ZD_ArticleTopBean> adapter) {
        super(context, parent, adapter, R.layout.item_recycleview2); //DaRongQI  //item_home_fool:   NeiRONG
    }

    @Override
    public void onFindViews(View itemView) {
        recyclerView03 = (RecyclerView) itemView.findViewById(R.id.recycler_view6);
    }

    @Override
    protected void onRefreshView(ZD_ArticleTopBean bean1, int position) {
        bean = (ZD_ArticleTopBean)bean1;

        List<ZD_ArticleTopBean.Data> data = bean.data;

        recyclerView03.setLayoutManager(new LinearLayoutManager
                (context, LinearLayoutManager.VERTICAL, false));   //vertical
        //适配器
         homeRanCarAdapter = new MainNewInfoAdapter(context, data);    //改
        recyclerView03.setAdapter(homeRanCarAdapter);

    }

//    @Override   // 集合
//    protected void onRefreshView(ZD_ArticleTopBean bean1, int position) {
//        bean = (ZD_ArticleTopBean)bean1;
//
//        List<ZD_ArticleTopBean.Data> data = bean.data;
//
//        recyclerView03.setLayoutManager(new LinearLayoutManager
//                (context, LinearLayoutManager.VERTICAL, false));   //vertical
//        //适配器
//        homeRanCarAdapter = new MainNewInfoAdapter(context, data);    //改
//        recyclerView03.setAdapter(homeRanCarAdapter);
//
//    }

//
//    private ImageView ivBigNewHead;
//    private TextView tvBigLeftTite;
//    private ImageView ivZXnewTitle;
//    private TextView tvBigRightTite;
//    private ImageView minPager;
//    private TextView tvMinRightTite;
//
//    private TextView tvInformationTitle;
//    private TextView tvInformationTime;
//    private ImageView ivInformationTitlePage;
//    private TextView carInfo;
//
//    /**
//     * 构造方法
//     *
//     * @param context 上下文对象
//     * @param parent  指RecyclerView控件
//     * @param adapter 适配器
//     *                ,@param layoutResId RecyclerView的一个item布局文件
//     */
//    public Info01NewHeaderHolder(Context context, ViewGroup parent, BaseAdapterRV<ZD_ArticleTopBean> adapter) {
//        super(context, parent, adapter, R.layout.fragment_choosecar02_news);
//    }
//
//    @Override
//    public void onFindViews(View itemView) {
//        initFindViewBid();
//    }
//
//
//    @Override
//    protected void onRefreshView(ZD_ArticleTopBean bean, int position) {
//
//        Picasso.with(context).load(bean.data.get(position).logo).into(ivBigNewHead);
//        tvBigLeftTite.setText(bean.data.get(position).title);
//
//        Picasso.with(context).load(bean.data.get(position).logo).into(ivZXnewTitle);
//        tvBigRightTite.setText(bean.data.get(position).title);
//
//        Picasso.with(context).load(bean.data.get(position).logo).into(minPager);
//        tvMinRightTite.setText(bean.data.get(position).title);
//
//    }
//
//
//
//    private void initFindViewBid() {
//        ivBigNewHead = itemView.findViewById(R.id.iv_bigNewHead);   //tu
//        tvBigLeftTite = itemView.findViewById(R.id.tv_bigLeftTite);  //tuWen
//        ivZXnewTitle = itemView.findViewById(R.id.iv_ZXnewTitle);    //右上图
//        tvBigRightTite = itemView.findViewById(R.id.tv_bigRightTite);  // 右边上文
//        minPager = itemView.findViewById(R.id.minPager);                //右下图
//        tvMinRightTite = itemView.findViewById(R.id.tv_minRightTite);     // 右下wen
//
//        tvInformationTitle = itemView.findViewById(R.id.tv_InformationTitle);   //   列表车标题
//        tvInformationTime = itemView.findViewById(R.id.tv_InformationTime);       // 时间
//        ivInformationTitlePage = itemView.findViewById(R.id.iv_InformationTitlePage);   //  车LOGE
//        carInfo = itemView.findViewById(R.id.tv_carInfo);   //车 描述
//
//    }
}
